package com.adam.springmvc.generator.mapper;

import com.adam.springmvc.generator.model.Tutor;
import com.adam.springmvc.generator.model.TutorExample;
import com.adam.springmvc.generator.model.TutorWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface TutorMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    long countByExample(TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int deleteByExample(TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    @Delete({
        "delete from tutors",
        "where tutor_id = #{tutorId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer tutorId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    @Insert({
        "insert into tutors (tutor_id, name, ",
        "email, phone, dob, ",
        "addr_id, bio, ",
        "pic)",
        "values (#{tutorId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{dob,jdbcType=DATE}, ",
        "#{addrId,jdbcType=INTEGER}, #{bio,jdbcType=LONGVARCHAR}, ",
        "#{pic,jdbcType=LONGVARBINARY})"
    })
    int insert(TutorWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int insertSelective(TutorWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    List<TutorWithBLOBs> selectByExampleWithBLOBs(TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    List<Tutor> selectByExample(TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    @Select({
        "select",
        "tutor_id, name, email, phone, dob, addr_id, bio, pic",
        "from tutors",
        "where tutor_id = #{tutorId,jdbcType=INTEGER}"
    })
    @ResultMap("com.adam.springmvc.generator.mapper.TutorMapper.ResultMapWithBLOBs")
    TutorWithBLOBs selectByPrimaryKey(Integer tutorId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int updateByExampleSelective(@Param("row") TutorWithBLOBs row, @Param("example") TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int updateByExampleWithBLOBs(@Param("row") TutorWithBLOBs row, @Param("example") TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int updateByExample(@Param("row") Tutor row, @Param("example") TutorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    int updateByPrimaryKeySelective(TutorWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    @Update({
        "update tutors",
        "set name = #{name,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "dob = #{dob,jdbcType=DATE},",
          "addr_id = #{addrId,jdbcType=INTEGER},",
          "bio = #{bio,jdbcType=LONGVARCHAR},",
          "pic = #{pic,jdbcType=LONGVARBINARY}",
        "where tutor_id = #{tutorId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(TutorWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tutors
     *
     * @mbg.generated Wed Aug 21 21:00:08 CST 2024
     */
    @Update({
        "update tutors",
        "set name = #{name,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "dob = #{dob,jdbcType=DATE},",
          "addr_id = #{addrId,jdbcType=INTEGER}",
        "where tutor_id = #{tutorId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Tutor row);
}